package com.bestcem.xm.user.dao;

import com.bestcem.xm.user.entity.pojo.RolePermissionDO;

import java.util.List;

/**
 * 角色权限 Dao
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/3/17 15:00
 */
public interface RolePermissionDao {

    /**
     * 保存角色权限
     *
     * @param rolePermissionDo
     * @return com.bestcem.xm.util.ServiceResult<java.lang.String>
     * @author Linzhijian <zhijian.lin@idiaoyan.com>
     * @date 2022/03/17 17:45
     */
    String insertSelective(RolePermissionDO rolePermissionDo);

    /**
     * 更新角色权限
     *
     * @param rolePermissionDo
     * @return com.bestcem.xm.util.ServiceResult<java.lang.Integer>
     * @author Linzhijian <zhijian.lin@idiaoyan.com>
     * @date 2022/03/17 17:45
     */
    Integer updateByPrimaryKeySelective(RolePermissionDO rolePermissionDo);

    /**
     * 根据roleId删除角色权限
     *
     * @param roleId
     * @return java.lang.Integer
     * @author Linzhijian <zhijian.lin@idiaoyan.com>
     * @date 2022/03/17 18:25
     */
    Integer deleteRolePermissionByRoleId(String roleId);

    /**
     * 根据orgId和roleId查询角色权限
     *
     * @param orgId
     * @param roleId
     * @return
     * @author Linzhijian <zhijian.lin@idiaoyan.com>
     * @date 2022/03/17 18:28
     */
    RolePermissionDO selectByOrgIdAndRoleId(String orgId, String roleId);

    /**
     * 通过角色id集合查询权限
     *
     * @param roleIds
     * @param orgId
     * @return List<RolePermissionDO>
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @version v1.0
     * @date 2022/3/18 11:28
     */
    List<RolePermissionDO> listByRoleIds(List<String> roleIds, String orgId);

    /**
     * 通过id集合批量更新角色权限
     *
     * @param roleIds
     * @param rolePermissionDO
     * @return Integer
     * @author wangyunyun <yunyun.wang@idiaoyan.com>
     * @version v1.0
     * @date 2022/3/21 11:32
     */
    Integer updateByIds(List<String> roleIds, RolePermissionDO rolePermissionDO);
}
